<template>
    <div class="wrapper">
        <div class="header">
            <el-row style="margin-bottom:20px" >
                <el-button type="danger" style="width:120px" @click="centerDialogVisible=true;title='新增'">新建</el-button>
            </el-row>
            <el-form label-position="right" label-width="80px">
             <el-row>
                <el-col :span="4" >
                     <el-form-item label="任务名称" >
                        <el-input v-model="searchBo.name" placeholder="请输入任务名称"></el-input>
                    </el-form-item>
                
                </el-col>
               <el-col :span="4" >
                     <el-form-item label="任务编号" >
                        <el-input v-model="searchBo.id" placeholder="请输入任务编号"></el-input>
                    </el-form-item>
                
                </el-col>
                <el-col :span="4" >
                     <el-form-item label="推送类型" prop="taskType">
                        <el-select clearable v-model="searchBo.taskType" placeholder="请选择推送类型">
                            <el-option
                            label="直播打赏"
                            value="1">
                            </el-option>
                             <el-option
                            label="直播带货"
                            value="2">
                            </el-option>
                             <el-option
                            label="粉丝关注"
                            value="3">
                            </el-option>
                        </el-select>
                    </el-form-item>
                
                </el-col>
                <el-col :span="4" >
                     <el-form-item label="内容类型" >
                        <el-select clearable v-model="searchBo.contentType" placeholder="请选择内容类型">
                            <el-option
                            v-for="item in content"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                
                </el-col>
                <el-col :span="4" style="margin-right:30px">
                     <el-form-item label="任务状态" >
                         <el-select clearable v-model="searchBo.status" placeholder="请选择任务状态">
                            <el-option
                            label="待审核"
                            value="1">
                            </el-option>
                             <el-option
                            label="驳回"
                            value="2">
                            </el-option>
                             <el-option
                            label="审核通过"
                            value="3">
                            </el-option>
                             <el-option
                            label="执行中"
                            value="10">
                            </el-option>
                             <el-option
                            label="暂停"
                            value="11">
                            </el-option>
                             <el-option
                            label="采集终止"
                            value="12">
                            </el-option>
                             <el-option
                            label="采集完成"
                            value="13">
                            </el-option>
                        </el-select>
                    
                    </el-form-item>
                
                </el-col>
                 <el-button type="danger" style="width:120px" @click="getList">查询</el-button>
            </el-row>
            </el-form>
        </div>
        <div class="body">
            <Table  :list="list" 
                    :state="false" 
                    v-loading="loading" 
                    :total="total" π
                    :indexTag="true"
                    @currentChange="currentChange"
                    @sizeChange="handSize">
               
               <slot>
                     <el-table-column label="操作" align="center" width="240px">
                        <template slot-scope="scope">
                            <el-row style="margin-bottom:5px">
                                 <el-button
                                size="mini"
                                type="success"
                                @click="showDetails(scope.row)">详情
                            </el-button>
                            <el-button
                                size="mini"
                                type="danger"
                                :disabled="scope.row.status !=1"
                                @click="handleEdit(scope.row)">修改
                            </el-button>
                            <el-button
                                size="mini"
                                type="info"
                                :disabled="scope.row.status !=1"
                                @click="handleDel(scope.row)">删除
                            </el-button>
                            </el-row>
                            <el-row>
                                <el-button
                                    size="mini"
                                    type="danger"
                                     v-if="scope.row.status == 1"
                                    @click="handleClick(scope.row,'审核通过')">审批通过
                                </el-button>
                                 <el-button
                                    size="mini"
                                    type="danger"
                                     v-if="scope.row.status == 2"
                                    @click="handleClick(scope.row,'待审核')">待审核
                                </el-button>
                                <el-button
                                    size="mini"
                                    type="primary"
                                     v-if="scope.row.status == 1"
                                    @click="handleClick(scope.row,'驳回')">审核驳回
                                </el-button>
                                 <el-button
                                    v-if="scope.row.status == 10"
                                    size="mini"
                                    type="primary"
                                    @click="handleClick(scope.row,'暂停')">暂停
                                </el-button>
                                 <el-button
                                   v-if="scope.row.status == 10 || scope.row.status == 11"
                                    size="mini"
                                    type="danger"
                                    @click="handleClick(scope.row,'采集终止')">终止
                                </el-button>
                                <el-button
                                   v-if="scope.row.status == 3||scope.row.status == 11"
                                    size="mini"
                                    type="primary"
                                    @click="handleClick(scope.row,'执行中')">执行
                                </el-button>
                                <el-button
                                   v-if="scope.row.status == 10 ||scope.row.status == 11 ||scope.row.status == 13"
                                    size="mini"
                                    type="primary"
                                    @click="target(scope.row)">推送详情
                                </el-button>
                            </el-row>
                        </template>
                    </el-table-column>
                </slot>
            </Table>
        </div>
        <el-dialog
            :title="title"
            :visible.sync="centerDialogVisible"
             :before-close="onCancel"
            width="40%"
            >
            <div>
                <el-form ref="addForm" :model="addForm" :rules="rule" label-position="right" label-width="140px">
                    <el-form-item label="任务名称" prop='name'>
                        <el-input v-model="addForm.name" placeholder="请输入任务名称"></el-input>
                    </el-form-item>
                    <el-form-item label="执行推送器" prop='pusherId'>
                        <el-select clearable v-model="addForm.pusherId" placeholder="请选择执行采集器">
                            <el-option
                            v-for="item in InfoList"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                            </el-option>
                        </el-select>
                        <!-- <el-input v-model="addForm.value" placeholder="请选择执行采集器"></el-input> -->
                    </el-form-item>
                    <el-form-item label="是否选择已有目标" prop='targetType'>
                         <el-radio-group v-model="addForm.targetType">
                            <el-radio :label="0">是</el-radio>
                            <el-radio :label="1">否</el-radio>
                        </el-radio-group>
                       
                    </el-form-item>
                    <el-form-item label="是否监控" prop='monitor'>
                         <el-radio-group v-model="addForm.monitor">
                            <el-radio :label="0">是</el-radio>
                            <el-radio :label="1">否</el-radio>
                        </el-radio-group>
                       
                    </el-form-item>
                    <el-form-item label="推送目标" prop='anchorId'>
                         <el-select v-if="addForm.targetType == 0" clearable v-model="addForm.anchorId" placeholder="请选择采集内容类型">
                            <el-option
                            v-for="item in contentList"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                            </el-option>
                        </el-select>
                        <el-input v-else v-model="addForm.anchorId" placeholder="请输入推送目标"></el-input>
                    </el-form-item>
                     <el-form-item label="客户名称" prop='customer'>
                        <el-input v-model="addForm.customer" placeholder="请输入客户名称"></el-input>
                    </el-form-item>
                    <el-form-item label="用户首页" prop='homeUrl'>
                        <el-input v-model="addForm.homeUrl" placeholder="请输入用户首页"></el-input>
                    </el-form-item>
                    <el-form-item label="作品地址" prop='opusUrl' >
                        <el-input v-model="addForm.opusUrl" placeholder="请输入作品地址"></el-input>
                    </el-form-item>
                     <el-form-item label="内容类型" prop='contentType'>
                           <el-select clearable v-model="addForm.contentType" placeholder="请选择内容类型">
                                <el-option
                                v-for="item in content"
                                :key="item.id"
                                :label="item.name"
                                :value="item.id">
                                </el-option>
                            </el-select>
                    </el-form-item>

                     <el-form-item label="时间段" prop='value1'>
                         <el-time-picker
                            is-range
                            v-model="addForm.value1"
                            type="daterange"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期">
                        </el-time-picker>
                        <!-- <el-input v-model="addForm.name" placeholder="请输入任务名称"></el-input> -->
                    </el-form-item>
                       <el-form-item label="地区" prop='region'>
                           <el-select clearable v-model="addForm.region" placeholder="请选择地区">
                               <el-option
                                label="无限制"
                                :value="0"
                               >
                               </el-option>
                            <el-option
                            v-for="item in regionList"
                            :key="item.id"
                            :label="item.province"
                            :value="item.provinceCode">
                            </el-option>
                        </el-select>
                    </el-form-item>
                       <el-form-item label="性别" prop='sex'>
                        <el-radio-group v-model="addForm.sex">
                            <el-radio :label="1">男</el-radio>
                            <el-radio :label="2">女</el-radio>

                            
                        </el-radio-group>
                    </el-form-item>
                       <el-form-item label="年龄段" prop='age'>
                        <el-select clearable v-model="addForm.age" placeholder="请选择年龄段">
                            <el-option
                            v-for="item in ageList"
                            :key="item.value"
                            :label="item.name"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="任务类型" prop='taskType'>
                         <el-radio-group v-model="addForm.taskType">
                            <el-radio :label="1">粉丝关注</el-radio>
                            <el-radio :label="2">直播打赏</el-radio>
                             <el-radio :label="3">直播带货</el-radio>
                        </el-radio-group>
                    </el-form-item>
                     <el-form-item label="推送数量" prop='normalCount' v-if="addForm.taskType !=2">
                        <el-input v-model="addForm.normalCount" placeholder="请输入推送数量"></el-input>
                    </el-form-item>
                    <span>推送数量（大哥等级）</span>
                     <el-form-item label="1-10" prop='bossL1Count' v-if="addForm.taskType==2">
                        <el-input v-model="addForm.bossL1Count" placeholder="大哥等级1-10 推送人数"></el-input>
                    </el-form-item>
                    <el-form-item label="11-20" prop='bossL2Count' v-if="addForm.taskType==2">
                        <el-input v-model="addForm.bossL2Count" placeholder="大哥等级1-10 推送人数"></el-input>
                    </el-form-item>
                    <el-form-item label="21-30" prop='bossL3Count' v-if="addForm.taskType==2">
                        <el-input v-model="addForm.bossL3Count" placeholder="大哥等级21-30 推送人数"></el-input>
                    </el-form-item>
                    <el-form-item label="31-40" prop='bossL4Count' v-if="addForm.taskType==2">
                        <el-input v-model="addForm.bossL4Count" placeholder="大哥等级31-40 推送人数"></el-input>
                    </el-form-item>
                    <el-form-item label="41-50" prop='bossL5Count' v-if="addForm.taskType==2">
                        <el-input v-model="addForm.bossL5Count" placeholder="大哥等级41-50 推送人数"></el-input>
                    </el-form-item>
                      <el-form-item label="51-60" prop='bossL6Count' v-if="addForm.taskType==2">
                        <el-input v-model="addForm.bossL6Count" placeholder="大哥等级51-60 推送人数"></el-input>
                    </el-form-item>

                     <el-form-item label="备注" prop='remark'>
                        <el-input type="textarea" v-model="addForm.remark" placeholder="请输入任务名称"></el-input>
                    </el-form-item>
                </el-form>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="onCancel">取 消</el-button>
                <el-button type="primary" @click="onOk">确 定</el-button>
            </span>
        </el-dialog>
        <el-dialog
            title="详情"
            :visible.sync="details"
            width="40%"
        >
            <el-row style="padding:0 20px">
                <!-- <h4 style="padding-bottom:10px;border-bottom:1px solid #ccc;margin-bottom:20px">详细情况</h4> -->
                <el-col :span="12" v-for="(item,index) in detailsInfo" :key="index" style="margin-bottom:20px" v-if="dictionary[index]">
                    <!-- {{index}} -->
                    <span v-if="index =='startTime'" >
                         {{dictionary[index]}} : {{detailsInfo[index] + "-" +detailsInfo['endTime']}}
                    </span>
                    
                    <span v-else-if="index =='taskType'" >
                         {{dictionary[index]}} : {{showtaskType(detailsInfo[index])}}
                    </span>
                    <span v-else-if="index =='contentType'" >
                         {{dictionary[index]}} : {{detailsInfo[index]=='1000'?'医美':'陶瓷'}}
                    </span>
                     <span v-else-if="index =='age'" >
                         {{dictionary[index]}} : {{showAge(detailsInfo[index])}}
                    </span>
                     <span v-else-if="index =='sex'" >
                         {{dictionary[index]}} : {{detailsInfo[index]=='0'?'不限':detailsInfo[index]=='1'?'男':'女'}}
                    </span>
                    <span v-else-if="index =='monitor'" >
                         {{dictionary[index]}} 
                    </span>
                    <span v-else >
                         {{dictionary[index]}} : {{detailsInfo[index]}}
                    </span>
                   
                </el-col>
                <el-row v-if='detailsInfo.taskType == 1'>
                    <!-- <el-col :span="24"  style="margin-bottom:20px">
                    <span>推送等级</span> 
                </el-col > -->
                 <el-col :span="24"  style="margin-bottom:20px">
                    <span>大哥等级</span> 
                </el-col>
                
                    <el-col :span="24"  style="margin-bottom:20px;margin-left:80px">
                            <span>1-10</span> : <span>{{detailsInfo['bossL1Count']}}</span>
                        </el-col>
                    <el-col :span="24"  style="margin-bottom:20px;margin-left:80px">
                            <span>11-20</span> : <span>{{detailsInfo['bossL2Count']}}</span>
                        </el-col>
                     <el-col :span="24"  style="margin-bottom:20px;margin-left:80px">
                           <span>21-30</span> : <span>{{detailsInfo['bossL3Count']}}</span>
                        </el-col>
                    <el-col :span="24"  style="margin-bottom:20px;margin-left:80px">
                           <span>31-40</span> : <span>{{detailsInfo['bossL4Count']}}</span>
                        </el-col>
                     <el-col :span="24"  style="margin-bottom:20px;margin-left:80px">
                            <span>41-50</span> : <span>{{detailsInfo['bossL5Count']}}</span>
                        </el-col>
                    <el-col :span="24"  style="margin-bottom:20px;margin-left:80px">
                            <span>51-60</span> : <span>{{detailsInfo['bossL6Count']}}</span>
                        </el-col>
                   
                </el-row>
                 <el-col :span="24"  style="margin-bottom:20px">
                        <span>备注</span> : <span>{{detailsInfo.remark}}</span>
                    </el-col>
            </el-row>

        </el-dialog>

    </div>
</template>

<script>
import {pusherTaskList,pusherTaskAdd,
pusherTaskEdit,pusherTaskDel,
pusherInfoList,pusherTargetList,
pusherCheck,getRegion
} from '../../../api/pusher'
import {collectorContentList
} from '../../../api/collector'
import Socket from '../../../utils/socket'
import Table from '@/components/Table'
import { getToken } from '../../../utils/auth'

export default {
    components:{
        Table
    },
    data () {
        return {
            list:{
        thead:[
            {label:'任务编号',prop:"id",rowspan:1},
            {label:'任务名称',prop:"name",rowspan:1},
            {label:'推送器编号',prop:"pusherId",rowspan:1},
            {label:'客户',prop:"customer",rowspan:1},
            {label:'内容类型',prop:"contentName",rowspan:1},
            {label:'推送类型',prop:"taskType",rowspan:1,formatter:(row,columns,text)=>{
                    switch (row.taskType) {
                        case 1:
                            return '直播打赏';
                        case 2:
                            return '直播带货';
                        case 3:
                            return '粉丝关注';
                        default:
                            return '';    
                    }
            }},
            {label:'推送时间段',prop:"taskType",width:'150px',rowspan:1,formatter:(row)=>{
                return row.startTime +"-" +row.endTime
            }},
            {label:'任务状态',prop:"status",rowspan:1,formatter:(row,columns,text)=>{
             
                    switch (row.status) {
                        case 1:
                            return '待审核';
                        case 2:
                            return '驳回';
                        case 3:
                            return '审核通过';
                        case 10:
                            return '执行中';
                        case 11:
                            return '暂停';
                        case 12:
                            return '采集终止';
                        case 13:
                            return '采集完成'; 
                        default:
                            return '';    
                    }
            }},
            {label:'计划数量',prop:"normalCount",rowspan:1},
            {label:'已推送数量',prop:"pushCount",rowspan:1},
            {label:'成功数量',prop:"pushSuccess",rowspan:1},
        ],
        tbody:[]
    },
    searchBo:{
        name:'',
    },
    loading:false,
    total:0,
    title:'新增',
    centerDialogVisible:false,
    addForm:{
        pusherId:'',
        name:'',
        targetType:'',
        customer:'',
        homeUrl:'',
        opusUrl:'',
        taskType:'',
        contentType:'',
        region:'',
        age:'',
        sex:'',
        monitor:'',
        normalCount:'',
        bossL1Count:'',
        bossL2Count:'',
        bossL3Count:'',
        bossL4Count:'',
        bossL5Count:'',
        bossL6Count:'',
        remark:'',
        monitor:'',
    },
    rule:{
        taskType:[ { required: true, message: '请选择任务类型', trigger: 'blur' },],
        value1:[ { required: true, message: '请选择时间', trigger: 'blur' },],
        name:[{ required: true, message: '请输入任务名称', trigger: 'blur' },],
        pusherId:[  { required: true, message: '请选择执行推送器', trigger: 'blur' },],
        targetType:[  { required: true, message: '请选择是否选择已有目标', trigger: 'blur' },],
        customer:[  { required: true, message: '请输入客户名称', trigger: 'blur' },],
        homeUrl:[  { required: true, message: '请输入用户首页', trigger: 'blur' },],
        opusUrl:[  { required: true, message: '请输入作品地址', trigger: 'blur' },],
        contentType:[  { required: true, message: '请选择内容分类', trigger: 'blur' },],
        monitor:[  { required: true, message: '请选择是否监控', trigger: 'blur' },],
        age:[  { required: true, message: '请选择年龄段', trigger: 'blur' },],
        sex:[  { required: true, message: '请选择性别', trigger: 'blur' },],
        region:[  { required: true, message: '请选择地区', trigger: 'blur' },],
        monitor:[  { required: true, message: '请选择', trigger: 'blur' },],
        normalCount:[  { required: true, message: '请输入', trigger: 'blur' },],
        bossL1Count:[  { required: true, message: '请输入', trigger: 'blur' },],
        bossL2Count:[  { required: true, message: '请输入', trigger: 'blur' },],
        bossL3Count:[  { required: true, message: '请输入', trigger: 'blur' },],
        bossL4Count:[  { required: true, message: '请输入', trigger: 'blur' },],
        bossL5Count:[  { required: true, message: '请输入', trigger: 'blur' },],
        bossL6Count:[  { required: true, message: '请输入', trigger: 'blur' },],
        remark:[  { required: true, message: '请输入备注', trigger: 'blur' },]
    },
    pageSize:20,
    pageNum:1,
    total:0,
    instructionClusterId:'',
    InfoList:[],
    contentList:[],
    regionList:[],
    details:false,
    dictionary:{
        'id':'任务编号',
        'name':'任务名称',
        'pusherId':'推送器编号',
        'customer':'客户名称',
        'taskType':'推送类型',
        'contentType':'内容类型',
        'homeUrl':'用户首页',
        'opusUrl':'作品地址',
        "province":'地区',
        "sex":'性别',
        "age":'年龄段',
        "startTime":'推送时间段',
        'normalCount':'推送数量',

        // "monitor":'大哥等级',
        // 'bossL1Count':'1-10',
        // 'bossL2Count':'11-20',
        // 'bossL3Count':'21-30',
        // 'bossL4Count':'31-40',
        // 'bossL5Count':'41-50',
        // 'bossL6Count':'51-60',
      
        // 'remark':'备注',

        
    },
    detailsInfo:{},
    statusList:{
           "待审核":1,
            "驳回":2,
            "审核通过":3,
            "执行中":10,
            "暂停":11,
            "采集终止":12, 
            "采集完成":13
    },
    ageList:[
        {name:'无限制',value:0},
        {name:'<18',value:1},
        {name:'18-23',value:2},
        {name:'24-30',value:3},
        {name:'31-40',value:4},
        {name:'41-50',value:5},
        {name:'>50',value:6},
    ],
    content:[]
        }
        
    },
    mounted () {
        this.getList();
         this.socket = new Socket({url:'ws://dev-ws.sqcat.cn/pusher-client/'+getToken(),callback:this.onMessage});
        pusherInfoList({
            pageNum:1,
            pageSize:0
        }).then(res=>{
            if(res.status =='200'){
                this.InfoList = [...res.data.list]
            }
        })
         collectorContentList({
            pageNum:1,
            pageSize:0
        }).then(res=>{
            if(res.status =='200'){
                this.content = [...res.data.list]
            }
        })
        pusherTargetList({
            pageNum:1,
            pageSize:0
        }).then(res=>{
            if(res.status =='200'){
                this.contentList = [...res.data.list]
            }
        });
        this.getRegionList()
    },
    destroyed () {
        this.socket.close()
    },
    methods:{
        showtaskType (row){
            switch (row) {
                 case 1:
                    return '直播打赏';
                case 2:
                    return '直播带货';
                case 3:
                    return '粉丝关注';
                default:
                    return '';    
            }
        },
        showAge (row) {
            switch (row) {
                case 1 :
                    return '<18'
                case 2 :
                    return '18-23'
                case 3 :
                    return '24-30'
                case 4 :
                    return '31-40'
                case 5 :
                    return '41-50'
                case 6 :
                    return '>50'
                case 0 :
                    return '无限制'
                default:
                    return ''
            }
         
        },
        target (row) {
            this.$router.push({path:'/pusher/details',query:{id:row.id}})
        },
        onMessage (data) {
           this.getList()

        },
         handSize (val) {
            this.pageNum = val;
            this.getList()
        },
        currentChange (val) {
            this.pageSize = val;
            this.getList()
        },
        /* 格式化时间 */
        GS (date) { 
            let time = new Date(date)
            let hours = time.getHours();
            let Min = time.getMinutes();
            let S = time.getSeconds();
            return `${hours}:${Min}:${S}`
        },
        onOk () {
            this.$refs['addForm'].validate((vaild)=>{
                console.log(this.addForm)
                if(vaild) {
                    this.addForm.startTime =  this.GS(this.addForm.value1[0])
                    this.addForm.endTime = this.GS(this.addForm.value1[1])
                    if(this.title == '新增'){
                        pusherTaskAdd(this.addForm).then(res=>{
                            if(res.status == 200) {
                                this.$message({
                                    type:'success',
                                    message:"新增成功！"
                                })
                                this.getList()
                                this.onCancel()
                            }else{
                                this.$message.error(res.msg)
                            }
                        })
                    }else{
                         pusherTaskEdit(this.addForm).then(res=>{
                            if(res.status == 200) {
                                this.$message({
                                    type:'success',
                                    message:"修改成功！"
                                })
                                this.getList()
                                this.onCancel()
                            }else{
                                this.$message.error(res.msg)
                            }
                        })
                    }
                }
            })
           
        },
        getRegionList () {
            getRegion().then(res=>{
                if(res.status == 200) {
                    this.regionList = [...res.data]
                }
            })
        },
        onCancel () {
            this.centerDialogVisible = false;
            this.addForm = this.$options.data().addForm;
            this.$refs['addForm'].clearValidate();
            this.$refs['addForm'].resetFields();
        },
        getList () {
            this.loading = true;
            let obj = {
                pageNum:this.pageNum,
                pageSize:this.pageSize,
                ...this.searchBo
            }
            pusherTaskList(obj).then(res=>{
                if(res.status == 200) {
                    this.total = res.data.total;
                    this.list.tbody = res.data.list;
                }else{
                        this.$message.error(res.msg)
                    }
                this.loading = false
            }).finally (res=>{
                this.loading = false
            })
        },
        getDate () {
            let time = new Date()
            let years = time.getFullYear();
            let mon = time.getMonth()+1;
            let day = time.getDay();

            return years+"-"+mon+"-"+day 

        },
        handleEdit (rows) {
            this.title = '修改'
            this.addForm = {...rows};
            this.addForm.value1 = [new Date(this.getDate()+" "+rows.startTime),new Date(this.getDate()+" "+rows.endTime)]
            console.log(this.addForm.value1)
            this.centerDialogVisible = true;
        },
        handleDel (row) {
            console.log(row)
             this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
                }).then(() => {
                    pusherTaskDel(row).then(res=>{
                        if(res.data) {
                            this.$message({
                                type: 'success',
                                message: '删除成功!'
                            });
                            this.getList()
                        }else{
                            this.$message({
                                type:'error',
                                message:res.msg
                            })
                        }
                    })
                    
                }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                });          
            });
        },
        handleClick (rows,type){
            pusherCheck(rows,this.statusList[type]).then(res=>{
                if(res.status == '200'){
                    this.$message({
                        type:'success',
                        message:'操作成功！'
                    });
                    this.getList()
                }else{
                    this.$message.error(res.msg)
                }
            })
        },
        showDetails (row){
            this.details = true;
            this.detailsInfo = row;
        }
    }
}
</script>

<style lang="less" scoped>
    .wrapper{
        width: 100%;
        overflow: auto;
        .header{
            height: 190px;
            margin-bottom: 25px;
            background-color: #fff;
            padding:38px 20px;
            box-sizing: border-box;;
        }
        .body{
            width: 100%;
            height:500px ;
            box-sizing: border-box;
            padding:10px 20px;
            overflow: auto;
            background-color: #fff;
        }
        

    }
</style>